﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace safehomeSimulation
{
    public partial class frmResponse : Form
    {
        private List<Msg> _msgs;

        public frmResponse()
        {
            InitializeComponent();
        }

        public frmResponse(ref List<Msg> coreMsg)
        {
            InitializeComponent();
            _msgs = coreMsg;
        }


        public  void ResponseTOMsg(List<Msg> msgs)
        {
            foreach (Msg one in msgs)
            {
                this.Text = one.location;
                switch (one.MId)
                {
                    case utility.ExceptionType.FireDisaster:
                        txtRes.Text = one.ProcessMessage;

                        lblTemperature.Text = one.ParaMessage;

                        break;
                    case utility.ExceptionType.CODisaster:
                        txtRes.Text = one.ProcessMessage;
                        lblCO.Text = one.ParaMessage;
                        break;
                    case utility.ExceptionType.WaterDisaster:
                        txtRes.Text = one.ProcessMessage;
                        lblWet.Text = one.ParaMessage;
                        break;
                }
            }
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
